package com.eorchis.module.classapplydep.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;



import org.hibernate.annotations.GenericGenerator;

import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.module.department.domain.Department;
import com.eorchis.module.trainingclass.domain.TrainingClass;

/**
 * Title: ClassApplyDep<br>
 * Description: 培训班-单位关系实体对象<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author HuangTF
 * @createDate 2013-12-18
 * @version $Revision$
 */
@Entity
@Table(name = "training_class_applydep")
public class ClassApplyDep implements IBaseEntity {
	private static final long serialVersionUID = 1L;

	private String classApplydepId;//培训班单位关系ID
	private TrainingClass trainingClass;//培训班
	private Department department;//单位
	private Long restrictPersonNum;//限制人数
	

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name="CLASS_APPLYDEP_ID")
	/**
	 * 设置培训班单位关系ID
	 */		
	public String getClassApplydepId() {
		return classApplydepId;
	}
	/**
	 * 获取培训班单位关系ID
	 */		
	public void setClassApplydepId(String classApplydepId) {
		this.classApplydepId = classApplydepId;
	}
	
	/**
	 * 获取培训班
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="CLASS_ID")
	public TrainingClass getTrainingClass() {
		return trainingClass;
	}
	/**
	 * 设置培训班
	 */
	public void setTrainingClass(TrainingClass trainingClass) {
		this.trainingClass = trainingClass;
	}
	
	/**
	 * 获取部门
	 */
	@ManyToOne(fetch = FetchType.LAZY, optional = true)
	@JoinColumn(name="DEPID")
	public Department getDepartment() {
		return department;
	}
	/**
	 * 设置部门
	 */
	public void setDepartment(Department department) {
		this.department = department;
	}
	@Column(name="RESTRICT_PERSON_NUM")
	/**
	 * 设置限制人数
	 */		
	public Long getRestrictPersonNum() {
		return restrictPersonNum;
	}
	/**
	 * 获取限制人数
	 */		
	public void setRestrictPersonNum(Long restrictPersonNum) {
		this.restrictPersonNum = restrictPersonNum;
	}
	

	/**
	 * 记录日志使用
	 */
//	public String toString() {
//		return "培训班单位关系ID======>" + getClassApplydepId()+"\n培训班ID======>" + getClassId()+"\n部门编号======>" + getDepid()+"\n限制人数======>" + getRestrictPersonNum();
//	}
}
